﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Collections;

namespace Agresso.Interface.Layer.Domain
{
    public class DADesk_PDA
    {
    //1<DAType>PDA</DAType> 
    //2<Company>PCL</Company>
    //3<AgentCode>0</AgentCode>
    //4<AgentName>Ban Seng Shipping PL</AgentName>
    //5<VesselCode>0</VesselCode>
    //6<VesselName>Ikan Seligi</VesselName>
    //7<PortCode>0</PortCode>
    //8<VoyageNo>26</VoyageNo>
    //9<TransactionDate>2012-08-27T17:30:00+04:00</TransactionDate>
    //10<Amount>4500</Amount>
    //11<Currency>SGD</Currency>
    //12<DADeskRef>PCL-120649-1</DADeskRef>
    //13<ETA>2012-08-29T00:00:00+04:00</ETA>
    //14<AccountCode>6126</AccountCode>
        public long pda_id = 0;
        public string DAType = "";
        public string Company = "";
        public string AgentCode = "";
        public string AgentName = "";
        public string VesselCode = "";
        public string VesselName = "";
        public string PortCode = "";
        public string VoyageNo = "";
        public DateTime TransactionDate = DateTime.Today;
        public decimal Amount = 0;
        public string Currency = "";
        public string DADeskRef = "";
        public DateTime ETA = DateTime.Today;
        public string AccountCode = "";
        
        public DateTime CreatedDate = DateTime.Now;
        public DateTime ModifiedDate = DateTime.Now;
        public string Status = "0";
        public string Remark = "";
        public string FileName = "";

        public IList Items = new ArrayList();

        public DADesk_PDA()
        {
        }
        public DADesk_PDA(SqlDataReader rd)
        {
            pda_id = Convert.ToInt32(rd["pda_id"]);
            DAType = rd["DAType"] is DBNull ? DAType : rd["DAType"].ToString();
            Company = rd["Company"] is DBNull ? Company : rd["Company"].ToString();
            AgentCode = rd["AgentCode"] is DBNull ? AgentCode : rd["AgentCode"].ToString();
            AgentName = rd["AgentName"] is DBNull ? AgentName : rd["AgentName"].ToString();
            VesselCode = rd["VesselCode"] is DBNull ? VesselCode : rd["VesselCode"].ToString();
            VesselName = rd["VesselName"] is DBNull ? VesselName : rd["VesselName"].ToString();
            PortCode = rd["PortCode"] is DBNull ? PortCode : rd["PortCode"].ToString();
            VoyageNo = rd["VoyageNo"] is DBNull ? VoyageNo : rd["VoyageNo"].ToString();
            TransactionDate = rd["TransactionDate"] is DBNull ? TransactionDate : Convert.ToDateTime(rd["TransactionDate"]);
            Amount = rd["Amount"] is DBNull ? Amount : Convert.ToDecimal(rd["Amount"]);
            Currency = rd["Currency"] is DBNull ? Currency : rd["Currency"].ToString();
            DADeskRef = rd["DADeskRef"] is DBNull ? DADeskRef : rd["DADeskRef"].ToString();
            ETA = rd["ETA"] is DBNull ? ETA : Convert.ToDateTime(rd["ETA"]);
            AccountCode = rd["AccountCode"] is DBNull ? AccountCode : rd["AccountCode"].ToString();
            CreatedDate = rd["CreatedDate"] is DBNull ? CreatedDate : Convert.ToDateTime(rd["CreatedDate"]);
            ModifiedDate = rd["ModifiedDate"] is DBNull ? ModifiedDate : Convert.ToDateTime(rd["ModifiedDate"]);
            Status = rd["Status"] is DBNull ? Status : rd["Status"].ToString();
            Remark = rd["Remark"] is DBNull ? Remark : rd["Remark"].ToString();
            FileName = rd["FileName"] is DBNull ? FileName : rd["FileName"].ToString();
        }
    }
}
